<body>
    <input id="postFile" type="file" name="logo" multiple>
    <button type="sub" onclick="upload()">上传</button>
</body>
<script>
    const upload = async () => {
        const body = new FormData()
        const postFile = document.getElementById('postFile')
        if (postFile.files[0]) {
            for (const file of postFile.files) {
                body.append('logo', file)
            }
            const response = await fetch('http://192.168.8.173:3000/postFile', {
                method: 'post',
                body
            })
            const res = await response.json()
            console.log(res)
        } else {
            alert('请选择文件！')
        }

    }
</script>
<!-- <script type="module" src="./index.js"></script> -->
